//
//  VideoCell.m
//  NeteaseNewsLY
//
//  Created by dllo on 16/1/21.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "VideoCell.h"
#import "VideoViewController.h"

@implementation VideoCell
- (void)dealloc
{
    [_playTime release];
    [_miaoshu release];
    [_title release];
    [_cover release];
    [_playCount release];
    [_timeImg release];
    [_playImg release];
    [_urlStr release];
    [_lineLabel release];
    [super dealloc];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // 线
        self.lineLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_lineLabel];
        [_lineLabel release];
        
        // 图片
        self.cover = [[UIImageView alloc] init];
        self.cover.layer.cornerRadius = 5;
        _cover.clipsToBounds = YES;
        [self.contentView addSubview:_cover];
        [_cover release];
        
        // 标题
        self.title = [[UILabel alloc] init];
        _title.font = [UIFont systemFontOfSize:18];
        [self.contentView addSubview:_title];
        [_title release];
        // 描述
        
        self.miaoshu = [[UILabel alloc] init];
        _miaoshu.textColor = [UIColor grayColor];
        [self.contentView addSubview:_miaoshu];
        [_miaoshu release];
        
        // 播放时间
        self.playTime = [[UILabel alloc] init];
        [self.contentView addSubview:_playTime];
        [_playTime release];
        
        //点击量
        self.playCount = [[UILabel alloc] init];
        [self.contentView addSubview:_playCount];
        [_playCount release];
        
        // 时间图片
        self.timeImg = [[UIImageView alloc] init];
        _timeImg.image = [UIImage imageNamed:@"time"];
        [self.contentView addSubview:_timeImg];
        [_timeImg release];
        // 播放次数图片
        self.playImg = [[UIImageView alloc] init];
        _playImg.image = [UIImage imageNamed:@"play"];
        [self.contentView addSubview:_playImg];
        [_playImg release];
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    
    _cover.frame = CGRectMake(WIDTH * 10, HEIGHT * 10, WIDTH * 355, HEIGHT * 200);
   
    _title.frame = CGRectMake(WIDTH * 10, HEIGHT * 210, WIDTH * 355, HEIGHT * 25);
    _title.font = [UIFont systemFontOfSize:15];

    _miaoshu.frame = CGRectMake(WIDTH * 10, HEIGHT * 240, WIDTH * 355, HEIGHT * 20);
    _miaoshu.font = [UIFont systemFontOfSize:12];
    _miaoshu.textColor = [UIColor grayColor];

    _lineLabel.frame = CGRectMake(WIDTH * 10, HEIGHT * 270, WIDTH * 335, HEIGHT * 1);
    _lineLabel.backgroundColor = [UIColor grayColor];
    _lineLabel.alpha = 0.5;

    _playTime.frame = CGRectMake(WIDTH * 35, HEIGHT * 280, WIDTH * 50, HEIGHT * 20);
    _playTime.font = [UIFont systemFontOfSize:12];
    _playTime.textColor = [UIColor grayColor];
//    _playTime.backgroundColor = [UIColor cyanColor];
    
    _playCount.frame = CGRectMake(WIDTH * 125, HEIGHT * 280, WIDTH * 50, HEIGHT * 20);
//    _playCount.backgroundColor = [UIColor redColor];
    _playCount.textColor = [UIColor grayColor];
    _playCount.font = [UIFont systemFontOfSize:12];
    
    _timeImg.frame = CGRectMake(WIDTH * 10, HEIGHT * 280, WIDTH * 20, HEIGHT * 20);
    _playImg.frame = CGRectMake(WIDTH * 90, HEIGHT * 280, WIDTH * 20, HEIGHT * 20);
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
